
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )

function ENT:Initialize()

	//util.PrecacheModel(self.Model or "models/weapons/w_pistol.mdl")
	//self:SetModel(self.Model or "models/weapons/w_pistol.mdl")

	local tracedata = {}
	tracedata.start = self:GetPos()
	tracedata.endpos = self:GetPos() + Vector(0,0,-900)
	tracedata.filter = self
	local trace = util.TraceLine(tracedata)
	self:SetPos(trace.HitPos+Vector(0,0,90))
	
	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_VPHYSICS ) 
	self:SetSolid( SOLID_VPHYSICS )
	
	local phys = self:GetPhysicsObject()
	if phys:IsValid() then
		phys:Wake()
		phys:SetVelocity(Vector(0,0,-1))
	end
end

function ENT:GetPrintName()
return Inventory.FindWeaponTable(self:GetModel()).Name end

function ENT:GetWeaponType()
return Inventory.FindWeaponTable(self:GetModel()).Weapon end

function ENT:Think()

end

function ENT:OnTakeDamage(dmg)
	
end 

function ENT:PhysicsCollide( data, physobj )
	if (data.Speed > 50 && data.DeltaTime > 0.2 ) then
		self:EmitSound(ChooseRandom(GameSounds.WeaponHit),math.random(60,100),math.random(80,120))
	end
end